package com.addplus.townmall.server.api.modelenum;

import java.util.HashMap;
import java.util.Map;

/**
 * 类名: BussinessEnum
 *
 * @author zhangjiehang
 * @version V1.0
 * @date 2018/9/25 下午4:04
 * @description 类描述:业务类型枚举类
 */
public enum BussinessEnum {
    /**
     * 业务类型枚举类
     */
    SELF_MAKE_GOOD(1, "自营商品"),
    ENTRY_GOOD(2, "企业商品"),
    GIFT_CARD_GOOD(3,"会员卡"),
    MEMBER_CARD_GOOD(4, "礼品卡"),
    PARENT_NUM(5, "父订单"),
    FIGHT_NUM(6, "拼团商品");

    private int status;
    private String stateInfo;

    BussinessEnum(int status, String stateInfo) {
        this.status = status;
        this.stateInfo = stateInfo;
    }

    private static final Map<Integer, BussinessEnum> lookup = new HashMap<Integer, BussinessEnum>();

    static {
        for (BussinessEnum bussinessEnum : BussinessEnum.values()) {
            lookup.put(bussinessEnum.getStatus(), bussinessEnum);
        }
    }

    public int getStatus() {
        return status;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public static BussinessEnum get(Integer type) {
        return lookup.getOrDefault(type,ENTRY_GOOD);
    }

}
